package api

import (
	"github.com/kataras/iris"
	"github.com/kataras/iris/core/router"
	"irisfarm/app/controllers"
	"irisfarm/app/core"
)

func ApiAuthRoutes(app router.Party) {
	c := controllers.UserController{}

	app.Post("/login", func(ctx iris.Context) {
		c.Login(ctx)
	})

	app.Get("/logout", core.JwtHandler.Serve, func(ctx iris.Context) {
		c.Logout(ctx)
	})
}
